﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MoneyDistr.Question;

namespace MoneyDistribution.Answer
{
    class Bob : IMoneyDistr
    {




        public long GetCount(int n, int[] Base)
        {
            long res = long.MaxValue;

            int[] money = new int[] { 1, 5, 7 };

            for (int i = 0; i < 3; i++)
            {
                for (int j = 0; j < 3; j++)
                {
                    if (j == i)
                    {
                        continue;
                    }

                    for (int k = 0; k < 3; k++)
                    {
                        if (k == i || k == j)
                        {
                            continue;
                        }

                        long cur = 0;
                        int rest = n;
                        cur += rest / money[i];
                        rest %= money[i];

                        cur += rest / money[j];
                        rest %= money[j];

                        cur += rest / money[k];
                        rest %= money[k];

                        res = Math.Min(res, cur);
                    }
                }
            }
            return res;

        }
    }
}
